package com.czg.jsonschema2lombokpojo.rules;

import com.czg.jsonschema2lombokpojo.Schema;

import com.fasterxml.jackson.databind.JsonNode;
import com.sun.codemodel.JDocComment;
import com.sun.codemodel.JDocCommentable;

/**
 * java命名规则
 */
public class JavaNameRule implements Rule<JDocCommentable, JDocComment> {

    @Override
    public JDocComment apply(String nodeName, JsonNode node, JsonNode parent, JDocCommentable generatableType, Schema currentSchema) {
        JDocComment javaDoc = generatableType.javadoc();

        javaDoc.append(String.format("%nCorresponds to the \"%s\" property.", nodeName));

        return javaDoc;
    }

}
